#ifndef SQLITE_QUERY_INTERFACE_H
#define SQLITE_QUERY_INTERFACE_H

#include <stdint.h>

#include <QDebug>
#include <QVariant>
#include <QSqlDatabase>
#include <QSqlError>
#include <QSqlQuery>

class SqliteQueryInterface
{
public:
    virtual std::optional<QSqlQuery> Execute(const QSqlDatabase &database) = 0;
};

class ReadAllFromPersonQuery : public SqliteQueryInterface {
public:
    std::optional<QSqlQuery> Execute(const QSqlDatabase &database) override;
};

class ReadFromPersonByPageQuery : public SqliteQueryInterface {
public:
    ReadFromPersonByPageQuery(int page, int number_of_pages);
    std::optional<QSqlQuery> Execute(const QSqlDatabase &database) override;
private:
    int page_;
    int number_of_pages_;
};

class ReadNameFromPersonQuery : public SqliteQueryInterface {
public:
    explicit ReadNameFromPersonQuery(int id);
    std::optional<QSqlQuery> Execute(const QSqlDatabase &database) override;
private:
    int32_t id_;
};


#endif // SQLITE_QUERY_INTERFACE_H
